#include <iostream>

using namespace std;

int Gcd(int m, int n)
{
	int temp = n;
	while(temp!=0)
	{
		n = temp;
		temp = m%n;
		m = n;
	}
	return n;
}

int main()
{
	int m, n;
	cin >> m >> n;
	int result = Gcd(m, n);
	if((m/result)%2==0) 
	{
		cout << "B" << endl;
	}else
	{
		cout << "A" << endl;
	}
	return 0;
}
